<!-- 提现管理 -->
<!-- 店铺审核 -->
<template>
    <div class="page-box h100 display-flex czbj">
        <p class="title-label mb10">
            店铺审核
        </p>
        <div>
            <dxtable :headBtn="headBtn" :dataJson="dataJson" :portUrl="portUrl" :qx="qx" ref="databale"
                sonRouter="xqEditingShop" :hidebj="true"></dxtable>
        </div>
        <n-modal v-model:show="showModal" preset="card" class="Stock-diagnosis">
            <template #header>
                <div>确认提现</div>
            </template>
            <div class="cen">
                <img :src="kkmxerr.moneyReceivingQRcode" class="kkmcfdgtytty imgjz">
                <p class="cen z9">
                    <span class="fz18 z3">提现金额为:<span class="red">{{ toFixed(kkmxerr.money)}}元</span> </span> <span
                        class="z9 fz12">(请扫付款码)</span>
                </p>
            </div>
            <template #action>
                <div class="tr">
                    <n-button @click="showModal = false"> 取消 </n-button>
                    <n-popconfirm @positive-click="ConfirmedWithdrawal">
                        <template #trigger>
                            <n-button type="primary" size="medium" class="ml20">确认提现</n-button>
                        </template>
                        确定完成了打款吗？
                    </n-popconfirm>


                </div>
            </template>
        </n-modal>
    </div>
</template>
<script lang='ts' setup>
import dxtable from "../../components/util/dxtable.vue";
import sort from "../../components/util/sort.vue";
import { dxget, dxpost, qurl, hf,toFixed } from "../../util/index";
import { h, ref, reactive } from "vue";
import { NButton } from "naive-ui"
const props = defineProps({
    pup: { type: String },
});
const showModal = ref(false)
const kkmxerr = ref()
let headBtn = [];
const databale = ref();
const initeer = () => {
    databale.value.initDataExpose();
};
const emit = defineEmits(["callBack"]);
const classifyoptions = ref()
const gysList = ref()
// 弹窗公用该列表

let dataJson = reactive([

    {
        title: "姓名",
        search: true, // 是否在搜索栏展示
        key: "name",
    },
    {
        title: "微信账号",
        search: true, // 是否在搜索栏展示
        key: "WechatID",
    }, {
        title: "提现金额",
        key: "money",
    },

    {
        title: "审核状态",
        key: "state",
        type: "select",
        search: true, // 是否在搜索栏展示
        options: [
            {
                label: "全部",
                value: ""
            }, {
                label: "等待提现",
                value: "1"
            }, {
                label: "提现成功",
                value: "2"
            }
        ],
        render(row) {
            if (row.state == 1) {
                return h("span", { class: "" }, "等待提现")
            }
            if (row.state == 2) {
                return h("span", { class: "ls" }, "提现成功")
            }
            if (row.state == 3) {
                return h("span", { class: "z9" }, "提现失败(" + row.AuditRemarks + ")")
            }
        }
    },
    {
        title: "排序",
        width: 100,
        render(row) {
            row.databaseName = "mhwithdrawDeposit";
            return h(sort, {
                row,
                onCallBack: () => {
                    initeer();
                },
            });
        },
    },
    {
        title: "申请时间",
        key: "addTime",
        width: "200",
        type: "daterange",
    },
    {
        title: "操作",
        width: "140",
        align: "center",
        render(row) {
            const arr = localStorage.rolemanagement.split(",");
            const czBtn = [];
            czBtn.push(
                h(
                    NButton,
                    {
                        type: "info",
                        quaternary: true,
                        onClick: () => {
                            showModal.value = true
                            kkmxerr.value = row
                        },
                    },
                    "点击提现"
                )
            );

            return czBtn;
        },
    },
]);
let portUrl = "mh/mhwithdrawDeposit";
const qx = {
    DeletePermissionID: "WithdrawalManagementdel", //删除
    EditPermissionIdentifier: "WithdrawalManagementbj", // 编辑
    NewPermissionIdentifier: "WithdrawalManagementxz", // 新建
    ViewPermissionID: "WithdrawalManagementck", // 查看
};





const ConfirmedWithdrawal = async() => {
    if(!kkmxerr.value.id){
        window.$message.error("获取id失败")
        return
    }
    await dxget("mh/phone/gxjjhsrr",{id:kkmxerr.value.id})
    initeer();
    showModal.value = false
}


</script>

<style scoped>
.kkmcfdgtytty {
    width: 250px;
    height: 250px;
    background: #e0e0e0;
}
</style>


